package com.hyq.service.impl;


import com.hyq.mapper.TeacherDAO;
import com.hyq.model.Teacher;
import com.hyq.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {
	
	@Autowired
	private TeacherDAO dao;
	
	@Override
	public Teacher sLoginTeacher(Teacher t) {
		
		return dao.sLoginTeacher(t);
	}
	
	@Override
	public int sRegisterTeacher(Teacher t) {
		
		return dao.sRegisterTeacher(t);
	}
	
	@Override
	public boolean validateNameTeacher(String name) {
		
		if(dao.validateNameTeacher(name) > 0){
			return false;
		}else{
			return true;
		}
	}
	
	@Override
	public int cOldPasswordTeacher(String password, int tid) {
		return dao.cOldPasswordTeacher(password, tid);
	}
	
	@Override
	public int updatePasswordTeacher(String password, int tid) {
		return dao.updatePasswordTeacher(password, tid);
	}
	
	@Override
	public List<Teacher> tUpdate(int tid) {
		return dao.tUpdate(tid);
	}
	
	@Override
	public int tBatchDelete(String[] arr) {
		return dao.tBatchDelete(arr);
	}
	
	@Override
	public List<Teacher> tSearch(String keyword) {
		return dao.tSearch(keyword);
	}
	
	@Override
	public Teacher tsearchById(int tid) {
		return dao.tsearchById(tid);
	}
	
	@Override
	public int tupdate(Teacher te) {
		return dao.tupdate(te);
	}
	
	@Override
	public int updateTnameTeacher(String tname, int tid) {
		return dao.updateTnameTeacher(tname, tid);
	}
	
	@Override
	public Teacher tRefind(int tid) {
		return dao.tRefind(tid);
	}

}
